{
	name:"CentralPoint",
	tool:"./paint_tool/points/point.shape",
	onFocusIn(){
		this.longToast("请选择任意俩点或者线段")
	},
	onClick(pos,e,meta){
		let step = this.step
		if(meta.pathPoint){
			step.push(meta.pathPoint)
			switch(step.length){
				case 1:
					this.toast("请选择第二个坐标点")
					this.point(meta.pathPoint)
					break
				case 2:
					this.onCommit(step[0],step[1])
					break
			}
			return
		}
		
		let line = this.queryLines(pos)
		if(line){
			let meta = this.getLM(line,pos)
			if(!meta.sp){
				this.toast("请选择任意目标线段")
				return
			}
			this.onCommit(meta,meta.sp)
			return
		}
		this.longToast("请选择任意俩点或者线段")
	},
	onCommit(fp,sp){
		let cp = Math.centralPos(fp,sp)
		this.step = [cp]
		this.commit(Action.Point,this.name)
	}
}